#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include "cardTest4.h"


//Function tests adventurer card
int cardTest4() {  
  int seed = 1000;
  int numPlayer = 2;

  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};

  struct gameState G;
  
  printf("=========================\n TESTING VILLAGE \n=========================\n");
  
  initializeGame(numPlayer, k, seed, &G);
  
  if(G.handCount[0]==5){
  	printf("TEST PASSED: Hand Count before village is %d\n", G.handCount[0]);
  } else {
  	printf("TEST FAILED: Hand Count before village is %d\n", G.handCount[0]);
  }
  
  cardEffect(village, 0, 0, 0, &G, 1, 0);

  
  if(G.handCount[0]==5){ //gain one, discard one
  	printf("TEST PASSED: Hand Count after village room is %d\n", G.handCount[0]);
  } else {
  	printf("TEST FAILED: Hand Count after village room is %d\n", G.handCount[0]); 
  }
  
  if(G.numActions == 3){ //gain one, discard one
  	printf("TEST PASSED: Number of actions after village room is %d\n", G.numActions);
  } else {
  	printf("TEST FAILED: Number of actions after village room is %d\n",G.numActions); 
  }
  
  
  //One card should be played 
  if(G.playedCardCount==1){
  	printf("TEST PASSED: Number of cards played: %d\n", G.playedCardCount);
  } else {
  	printf("TEST FAILED: Number of cards played: %d\n", G.playedCardCount); //Fails, card is not played at the end
  }

  return 0;
}